<div class="row align-items-center justify-content-between">
    <div class="col-md-auto col-sm-auto">
        <div class="content-header">
            <h1>
                邮箱 SMTP 设置
            </h1>
        </div>
    </div>
    <div class="col-md-auto col-sm-auto">
        <h4 class="widget-title">
            <button [routerLink]="['/admin/email-smtp/manage']" class="btn btn-success btn-sm m-right-10">
                <i class="fas fa-plus"></i>
                添加 SMTP 设置
            </button>
        </h4>
    </div>
</div>
<div class="box box-primary">
    <div class="box-body">
        <div class="table-container">
            <table mat-table [dataSource]="emailSMTPSettings">
                <!-- Action Column -->
                <ng-container matColumnDef="action">
                    <th style="width:30%" mat-header-cell *matHeaderCellDef>操作 </th>
                    <td style="width:30%" mat-cell *matCellDef="let emailSMTPSetting">
                        <button [routerLink]="['/admin/email-smtp/manage', emailSMTPSetting.id]"
                            class="btn btn-success btn-sm m-right-10" type="button">
                            <i class="fas fa-pencil-alt"></i>
                            <span class="d-none d-sm-inline"> 编辑</span>
                        </button>
                        <button class="btn btn-danger btn-sm" type="button"
                            (click)="deleteEmailSMTPSetting(emailSMTPSetting)">
                            <i class="fas fa-trash-alt"></i>
                            <span class="d-none d-sm-inline"> 删除</span>
                        </button>
                    </td>
                </ng-container>

                <ng-container matColumnDef="host">
                    <th mat-header-cell *matHeaderCellDef> 主机 </th>
                    <td mat-cell *matCellDef="let emailSMTPSetting"> {{emailSMTPSetting.host}} </td>
                </ng-container>

                <ng-container matColumnDef="userName">
                    <th mat-header-cell *matHeaderCellDef> 用户名</th>
                    <td mat-cell *matCellDef="let emailSMTPSetting"> {{emailSMTPSetting.userName}} </td>
                </ng-container>

                <ng-container matColumnDef="port">
                    <th mat-header-cell *matHeaderCellDef>端口 </th>
                    <td mat-cell *matCellDef="let emailSMTPSetting"> {{emailSMTPSetting.port}} </td>
                </ng-container>

                <ng-container matColumnDef="isDefault">
                    <th mat-header-cell *matHeaderCellDef> 是否默认 </th>
                    <td mat-cell *matCellDef="let emailSMTPSetting"> {{emailSMTPSetting.isDefault ? "是" : "否"}} </td>
                </ng-container>
                <tr mat-header-row *matHeaderRowDef="displayedColumns;sticky: true" style="background-color: #eee;">
                </tr>
                <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
            </table>
        </div>
    </div>
</div>
